.class public Lrexsee/dialog/RexseeDialog;
.super Ljava/lang/Object;
.source "RexseeDialog.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field private static final INTERFACE_NAME:Ljava/lang/String; = "Dialog"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mContext:Landroid/content/Context;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 1
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 35
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 36
    iput-object p1, p0, Lrexsee/dialog/RexseeDialog;->mBrowser:Lrexsee/core/browser/Browser;

    .line 37
    invoke-virtual {p1}, Lrexsee/core/browser/Browser;->getContext()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    .line 38
    return-void
.end method

.method static synthetic access$0(Lrexsee/dialog/RexseeDialog;)Landroid/content/Context;
    .locals 1

    .prologue
    .line 31
    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/dialog/RexseeDialog;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 32
    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method


# virtual methods
.method public alert(Ljava/lang/String;Ljava/lang/String;)V
    .locals 2
    .param p1, "title"    # Ljava/lang/String;
    .param p2, "message"    # Ljava/lang/String;

    .prologue
    .line 60
    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x104000a

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {p0, p1, p2, v0, v1}, Lrexsee/dialog/RexseeDialog;->alert(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 61
    return-void
.end method

.method public alert(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 2
    .param p1, "title"    # Ljava/lang/String;
    .param p2, "message"    # Ljava/lang/String;
    .param p3, "callback"    # Ljava/lang/String;

    .prologue
    .line 63
    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x104000a

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, p1, p2, v0, p3}, Lrexsee/dialog/RexseeDialog;->alert(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 64
    return-void
.end method

.method public alert(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 8
    .param p1, "title"    # Ljava/lang/String;
    .param p2, "message"    # Ljava/lang/String;
    .param p3, "button"    # Ljava/lang/String;
    .param p4, "callback"    # Ljava/lang/String;

    .prologue
    .line 66
    iget-object v1, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    move-object v0, v1

    check-cast v0, Landroid/app/Activity;

    move-object v7, v0

    new-instance v1, Lrexsee/dialog/RexseeDialog$1;

    move-object v2, p0

    move-object v3, p1

    move-object v4, p2

    move-object v5, p3

    move-object v6, p4

    invoke-direct/range {v1 .. v6}, Lrexsee/dialog/RexseeDialog$1;-><init>(Lrexsee/dialog/RexseeDialog;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v7, v1}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V

    .line 94
    return-void
.end method

.method public confirm(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 7
    .param p1, "title"    # Ljava/lang/String;
    .param p2, "message"    # Ljava/lang/String;
    .param p3, "confirmCallback"    # Ljava/lang/String;

    .prologue
    .line 96
    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x104000a

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v3

    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const/high16 v1, 0x1040000

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    const/4 v6, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v5, p3

    invoke-virtual/range {v0 .. v6}, Lrexsee/dialog/RexseeDialog;->confirm(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 97
    return-void
.end method

.method public confirm(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 7
    .param p1, "title"    # Ljava/lang/String;
    .param p2, "message"    # Ljava/lang/String;
    .param p3, "confirmCallback"    # Ljava/lang/String;
    .param p4, "cancelCallback"    # Ljava/lang/String;

    .prologue
    .line 99
    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v1, 0x104000a

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v3

    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const/high16 v1, 0x1040000

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v5, p3

    move-object v6, p4

    invoke-virtual/range {v0 .. v6}, Lrexsee/dialog/RexseeDialog;->confirm(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 100
    return-void
.end method

.method public confirm(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 10
    .param p1, "title"    # Ljava/lang/String;
    .param p2, "message"    # Ljava/lang/String;
    .param p3, "confirmButton"    # Ljava/lang/String;
    .param p4, "cancelButton"    # Ljava/lang/String;
    .param p5, "confirmCallback"    # Ljava/lang/String;
    .param p6, "cancelCallback"    # Ljava/lang/String;

    .prologue
    .line 102
    iget-object v1, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    move-object v0, v1

    check-cast v0, Landroid/app/Activity;

    move-object v9, v0

    new-instance v1, Lrexsee/dialog/RexseeDialog$2;

    move-object v2, p0

    move-object v3, p1

    move-object v4, p2

    move-object v5, p3

    move-object v6, p4

    move-object v7, p5

    move-object/from16 v8, p6

    invoke-direct/range {v1 .. v8}, Lrexsee/dialog/RexseeDialog$2;-><init>(Lrexsee/dialog/RexseeDialog;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v9, v1}, Landroid/app/Activity;->runOnUiThread(Ljava/lang/Runnable;)V

    .line 138
    return-void
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 24
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 20
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/dialog/RexseeDialog;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "Dialog"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 28
    new-instance v0, Lrexsee/dialog/RexseeDialog;

    invoke-direct {v0, p1}, Lrexsee/dialog/RexseeDialog;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public toast(Ljava/lang/String;)V
    .locals 2
    .param p1, "message"    # Ljava/lang/String;

    .prologue
    .line 42
    iget-object v0, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    const/4 v1, 0x0

    invoke-static {v0, p1, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    .line 43
    return-void
.end method

.method public toast(Ljava/lang/String;Ljava/lang/String;)V
    .locals 9
    .param p1, "message"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;

    .prologue
    const-string v8, "px"

    const-string v7, ""

    .line 46
    const-string v0, "icon-visibility:false;window-style:dark;window-align:center;window-vertical-align:bottom;top:-20;left:0;background-color:transparent;label-background-color:transparent;border-width:0;"

    .line 47
    .local v0, "defaultStyle":Ljava/lang/String;
    new-instance v1, Lrexsee/core/widget/LabelDiv;

    iget-object v3, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-direct {v1, v3}, Lrexsee/core/widget/LabelDiv;-><init>(Landroid/content/Context;)V

    .line 48
    .local v1, "label":Lrexsee/core/widget/LabelDiv;
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ";label:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ";"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v3}, Lrexsee/core/widget/LabelDiv;->setStyle(Ljava/lang/String;)V

    .line 49
    iget-object v3, v1, Lrexsee/core/widget/LabelDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->window_style:Ljava/lang/String;

    const-string v4, "transparent"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_0

    .line 50
    iget-object v3, v1, Lrexsee/core/widget/LabelDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getWindowStyle()I

    move-result v3

    invoke-virtual {v1, v3}, Lrexsee/core/widget/LabelDiv;->setBackgroundResource(I)V

    .line 52
    :cond_0
    new-instance v2, Landroid/widget/Toast;

    iget-object v3, p0, Lrexsee/dialog/RexseeDialog;->mContext:Landroid/content/Context;

    invoke-direct {v2, v3}, Landroid/widget/Toast;-><init>(Landroid/content/Context;)V

    .line 53
    .local v2, "toast":Landroid/widget/Toast;
    invoke-virtual {v2, v1}, Landroid/widget/Toast;->setView(Landroid/view/View;)V

    .line 54
    iget-object v3, v1, Lrexsee/core/widget/LabelDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getWindowGravity()I

    move-result v3

    iget-object v4, v1, Lrexsee/core/widget/LabelDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v4, v4, Lrexsee/core/style/StyleSheet;->left:Ljava/lang/String;

    invoke-virtual {v4}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v4

    const-string v5, "px"

    const-string v5, ""

    invoke-virtual {v4, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v4

    iget-object v5, v1, Lrexsee/core/widget/LabelDiv;->styleSheet:Lrexsee/core/style/StyleSheet;

    iget-object v5, v5, Lrexsee/core/style/StyleSheet;->top:Ljava/lang/String;

    invoke-virtual {v5}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v5

    const-string v6, "px"

    const-string v6, ""

    invoke-virtual {v5, v8, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v5

    invoke-virtual {v2, v3, v4, v5}, Landroid/widget/Toast;->setGravity(III)V

    .line 55
    const/4 v3, 0x1

    invoke-virtual {v2, v3}, Landroid/widget/Toast;->setDuration(I)V

    .line 56
    invoke-virtual {v2}, Landroid/widget/Toast;->show()V

    .line 58
    return-void
.end method
